/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/** *****************************************************************************************************
 * \file     Icu_Irq.c                                                                                  *
 * \brief    This file mainly contains the implement of etimer interrupt handler                        *
 *                                                                                                      *
 * <table>                                                                                              *
 * <tr><th>Date           <th>Version                                                                   *
 * <tr><td>2023/08/18     <td>1.0.0                                                                     *
 * </table>                                                                                             *
 *******************************************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif


/********************************************************************************************************
 *                                      Include header files                                            *
 *******************************************************************************************************/
/* icu-irq self file */
#include "Icu_Irq.h"
/* icu data type file */
/** Traceability       : SWSR_ICU_002 */
#include "Icu.h"
#include "Icu_Cfg.h"
/********************************************************************************************************
 *                                      External Function                                               *
 *******************************************************************************************************/

/* memap information */
#define ICU_START_SEC_CODE_FAST
/** Traceability       : SWSR_ICU_004 */
#include "Icu_MemMap.h"


/********************************************************************************************************
 *                                  Global Function Declarations                                        *
 *******************************************************************************************************/
#define ICU_ISR(id)                                         ISR(Icu_Irq##id##_Handle)\
                                                            {\
                                                                Icu_IrqCommon(ICU_INDEX_ETIMER##id);\
                                                            }
#if (STD_OFF ==  ICU_XTRG_CPT_WITH_GPIO_INT)
#define ICU_XTRG_ISR(id)                                    ISR(Icu_XtrgIrq##id##_Handle)\
                                                            {\
                                                                Icu_XtrgIrqCommon(ICU_INDEX_XTRG##id);\
                                                            }
#else
#define ICU_XTRG_ISR(id)
#endif

/** *****************************************************************************************************
 * \brief etimer1 interrupt handler
 *
 * \verbatim
 * Syntax             : void Icu_Irq1_Handle(void)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : None
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : The setting result
 *
 * Description        : etimer1 interrupt handler
 * \endverbatim
 * Traceability       : SWSR_ICU_036
 *******************************************************************************************************/
ICU_ISR(1)

/** *****************************************************************************************************
 * \brief etimer2 interrupt handler
 *
 * \verbatim
 * Syntax             : void Icu_Irq2_Handle(void)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : None
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : The setting result
 *
 * Description        : etimer2 interrupt handler
 * \endverbatim
 * Traceability       : SWSR_ICU_036
 *******************************************************************************************************/
ICU_ISR(2)

/** *****************************************************************************************************
 * \brief etimer3 interrupt handler
 *
 * \verbatim
 * Syntax             : void Icu_Irq3_Handle(void)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : None
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : The setting result
 *
 * Description        : etimer3 interrupt handler
 * \endverbatim
 * Traceability       : SWSR_ICU_036
 *******************************************************************************************************/
ICU_ISR(3)

/** *****************************************************************************************************
 * \brief etimer4 interrupt handler
 *
 * \verbatim
 * Syntax             : void Icu_Irq4_Handle(void)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : None
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : The setting result
 *
 * Description        : etimer4 interrupt handler
 * \endverbatim
 * Traceability       : SWSR_ICU_036
 *******************************************************************************************************/
ICU_ISR(4)

#if (STD_OFF ==  ICU_XTRG_CPT_WITH_GPIO_INT)
/** *****************************************************************************************************
 * \brief etimer1 interrupt handler
 *
 * \verbatim
 * Syntax             : void Icu_XtrgIrq1_Handle(void)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : None
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : The setting result
 *
 * Description        : xtrg1 capture interrupt handler
 * \endverbatim
 * Traceability       : SWSR_ICU_036
 *******************************************************************************************************/
ICU_XTRG_ISR(1)

/** *****************************************************************************************************
 * \brief etimer1 interrupt handler
 *
 * \verbatim
 * Syntax             : void Icu_XtrgIrq2_Handle(void)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : None
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : The setting result
 *
 * Description        : xtrg2 capture interrupt handler
 * \endverbatim
 * Traceability       : SWSR_ICU_036
 *******************************************************************************************************/
ICU_XTRG_ISR(2)
#endif

/* memap information */
#define ICU_STOP_SEC_CODE_FAST
#include "Icu_MemMap.h"

#ifdef __cplusplus
}
#endif

/* End of file */
